<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 1.求1-100之间的所有数的平均值
        /*     let sum = 0;
            for(let i = 1; i<=100; i++){
                sum+=i;
            }
            console.log(sum, sum/100); */

        // 2. 求1-100之间所有偶数和,奇数的和  偶数 even 奇数 odd
        /* let even = 0;
        let odd = 0;
        for (let i = 0; i <= 100; i++) {
            if (i % 2 == 0) {
                even += i
            }else{
                odd += i;
            }
        }
        console.log(even,odd) */
        // 3. 求1-100之间所有能被3整除的数字的和 
        /*  let num = 0;
         for (let i = 0; i <= 100; i++) {
             if(i%3==0){
               num +=i;
             } 
         }
         console.log(num); */
        // 4. 逢7过：7的倍数,个位是7的数字不输出。
        for (i = 0; i < 100; i++) {
            if ((i % 7 != 0) && (i % 10 != 7) && (parseInt(i / 10) != 7)) {
                console.log(i);
            }
        }
    </script>
</body>

</html>